


#import "User.h"

@implementation User
+ (NSArray *)bg_unionPrimaryKeys
{
    return @[@"ID",@"account"];

}
- (NSString *)account{
    if (!_account) {
        _account = @"去登录";
    }
    return _account;
}
- (NSData *)headImg{
    if (!_headImg) {
       UIImage *img = [UIImage imageNamed:@"默认头像"];
        _headImg = UIImageJPEGRepresentation(img, 1);
    }
    return _headImg;
}
-(NSString *)username{
    if (!_username) {
        _username = @"去登录";
    }
    return _username;
}
+(void)load
{
    [self mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
        return @{@"ID":@"id"};
    }];
}
- (NSString *)ID{
    if (!_ID) {
        _ID = @"去登录";
    }
    return _ID;
}
@end
